package com.example.dynamicdatasource.dao;

import com.example.dynamicdatasource.entity.UserEntity;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface DBUserDao{

    @Insert("insert into user(name,age) values(#{name},#{age})")
    int addUser(UserEntity entity);

    @Select("select * from user where id = #{id}")
    UserEntity findUser(@Param("id") Long id);
}
